package com.google.code.rgbgoesbetween.data;

public interface Datastore {
	
	/**
	 * This method queries the datastore for a certain account, as given
	 * by a username and a password hash. If the user information is not
	 * found, this will return null.
	 * @param username The user's profile name
	 * @param passHash The user's password hashcode
	 * @return A Profile object
	 */
	public Profile getAccountInfo(String username, String passHash);
	
	/**
	 * This method inserts a new record into the datastore. This method will do nothing
	 * if the record already exists and will return null. Otherwise, it 
	 * will create the profile and return its value.
	 * @param profile The Profile indicating what to create
	 * @return The created or already existing profile.
	 */
	public Profile createProfile(Profile profile);
	
	/**
	 * This method takes in a Profile object and updates it in the datastore. It 
	 * updates the information in the datastore if the credentials are valid, and
	 * it returns an enumeration that represents the status of the query.
	 * @param profile The profile with updates
	 * @return The status of the update.
	 */
	public QueryStatus updateProfile(Profile profile);
	
	/**
	 * This method creates an item in the datastore and returns an enumeration on 
	 * the status of the call.
	 * @param item The item to create
	 * @return The status of the Query
	 */
	public QueryStatus createItem(Item item);
	
	/**
	 * This method updates an item in the datastore and returns an enumeration on 
	 * the status of the call.
	 * @param item The item/info to update
	 * @return The status of the call
	 */
	public QueryStatus updateItem(Item item);
	
	/**
	 * This method deletes an item in the datastore and returns an enumeration on 
	 * the status of the call. Optimally, we don't actually delete, and instead we
	 * move the info to another table.
	 * @param item This is the item to delete
	 * @return The status of the call
	 */
	public QueryStatus deleteItem(Item item);
	
	/**
	 * This simply calls an item by its ID
 	 * @param id The desired item ID.
	 * @return The item with given ID
	 */
	public Item requestItem(int id);
}
